package com.ruoyi.ora.service.impl;

import java.util.Collections;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ora.domain.VoiceRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ora.mapper.VoiceMemoirMapper;
import com.ruoyi.ora.domain.VoiceMemoir;
import com.ruoyi.ora.service.IVoiceMemoirService;

/**
 * 录音回忆录Service业务层处理
 * 
 * @author liuwp
 * @date 2025-04-10
 */
@Service
public class VoiceMemoirServiceImpl implements IVoiceMemoirService 
{
    @Autowired
    private VoiceMemoirMapper voiceMemoirMapper;

    /**
     * 查询录音回忆录
     * 
     * @param id 录音回忆录主键
     * @return 录音回忆录
     */
    @Override
    public VoiceMemoir selectVoiceMemoirById(Long id)
    {
        return voiceMemoirMapper.selectVoiceMemoirById(id);
    }

    /**
     * 查询录音回忆录列表
     * 
     * @param voiceMemoir 录音回忆录
     * @return 录音回忆录
     */
    @Override
    public List<VoiceMemoir> selectVoiceMemoirList(VoiceMemoir voiceMemoir)
    {
        return voiceMemoirMapper.selectVoiceMemoirList(voiceMemoir);
    }

    @Override
    public List<VoiceMemoir> selectVoiceMemoirListCollection(VoiceMemoir voiceMemoir) {
        return voiceMemoirMapper.selectVoiceMemoirListCollection(voiceMemoir);
    }

    @Override
    public List<VoiceMemoir> selectVoiceMemoirListDeviceUser(VoiceMemoir voiceMemoir) {
        return voiceMemoirMapper.selectVoiceMemoirListDeviceUser(voiceMemoir);
    }

    /**
     * 根据业务主键查询一条记录：录音回忆录
     *
     * @param voiceMemoir 录音回忆录
     * @return 录音回忆录
     */
    @Override
    public VoiceMemoir selectOneVoiceMemoir(VoiceMemoir voiceMemoir)
    {
        return voiceMemoirMapper.selectOneVoiceMemoir(voiceMemoir);
    }

    /**
     * 新增录音回忆录
     * 
     * @param voiceMemoir 录音回忆录
     * @return 结果
     */
    @Override
    public int insertVoiceMemoir(VoiceMemoir voiceMemoir)
    {
        voiceMemoir.setCreateTime(DateUtils.getNowDate());
        return voiceMemoirMapper.insertVoiceMemoir(voiceMemoir);
    }

    /**
     * 修改录音回忆录
     * 
     * @param voiceMemoir 录音回忆录
     * @return 结果
     */
    @Override
    public int updateVoiceMemoir(VoiceMemoir voiceMemoir)
    {
        return voiceMemoirMapper.updateVoiceMemoir(voiceMemoir);
    }

    @Override
    public int updateVoiceMemoirCondition(VoiceMemoir voiceMemoir, VoiceMemoir voiceMemoirCondition)
    {
        return voiceMemoirMapper.updateVoiceMemoirCondition(voiceMemoir, voiceMemoirCondition);
    }

    /**
     * 批量删除录音回忆录
     * 
     * @param ids 需要删除的录音回忆录主键
     * @return 结果
     */
    @Override
    public int deleteVoiceMemoirByIds(Long[] ids)
    {
        return voiceMemoirMapper.deleteVoiceMemoirByIds(ids);
    }

    /**
     * 删除录音回忆录信息
     * 
     * @param id 录音回忆录主键
     * @return 结果
     */
    @Override
    public int deleteVoiceMemoirById(Long id)
    {
        return voiceMemoirMapper.deleteVoiceMemoirById(id);
    }

    /**
     * 条件删除录音回忆录
     *
     * @param voiceMemoir 录音回忆录
     * @return 结果
     */
    @Override
    public int deleteVoiceMemoirByCondition(VoiceMemoir voiceMemoir)
    {
        return voiceMemoirMapper.deleteVoiceMemoirByCondition(voiceMemoir);
    }

}
